#ifndef UILOADER_H
#define UILOADER_H

#include <QUiLoader>
#include <QScriptValue>

class AbstractContainer;

class UiLoader : public QUiLoader
{
    Q_OBJECT
public:
    UiLoader(QObject *parent = 0);
    virtual QWidget *createWidget(const QString &className, QWidget *parent = 0,
                                  const QString &name = QString());

public slots:
    QWidget* load(QString str, AbstractContainer *cons = 0);
    QWidget* load(QIODevice* d, QWidget* parent=0);

private:
    inline void extraProperties(const QString &scriptValue, const QString &className);

private:
    AbstractContainer* m_connections;
    AbstractContainer* cons;
    QWidget *m_mainWidget;
    QScriptValue m_scriptWidget;
};

#endif // UILOADER_H

